home *** CD-ROM | disk | FTP | other *** search
- /*******************************************************************************
- * Copyright © 1992-1993 Mark Pilgrim *
- * *
- * This file is provided as is, and may be freely distributed unaltered. This *
- * message must accompany any copy of this file. This file may be used or *
- * modified for use for a non-commercial product provided that appropriate *
- * credit is given to the author named above. *
- * Commercial use of this source code is prohibited. *
- ******************************************************************************/
-
- #include "msg misc.h"
- #include "msg timing.h"
-
- #define VBarGap 10
- #define HBarGap (VBarGap*MAIN_WINDOW_HEIGHT/MAIN_WINDOW_WIDTH)
- #define CorrectTime 3
-
- void BoxInWipe(GrafPtr);
-
- /* Basically, there are four bars -- one starts at the top and moves down;
- one starts at the bottom and moves up; one starts at the left and moves
- right; one starts at the right and moves left. There's a lot of overlap
- of bitcopying, but it's masked by the timing correction */
-
- void BoxInWipe(GrafPtr sourceGrafPtr)
- {
- Rect vsource1,vsource2, hsource1, hsource2;
- int vbar,hbar;
-
- vbar=0;
- hbar=0;
- vsource1.top=vsource2.top=hsource2.left=hsource1.left=0; /* these */
- vsource1.bottom=vsource2.bottom=MAIN_WINDOW_HEIGHT; /* never */
- hsource1.right=hsource2.right=MAIN_WINDOW_WIDTH; /* change */
- while (vbar<MAIN_WINDOW_WIDTH/2+VBarGap)
- {
- StartTiming();
- vsource1.left=vbar;
- vsource1.right=vsource1.left+VBarGap;
- vsource2.right=MAIN_WINDOW_WIDTH-vbar;
- vsource2.left=vsource2.right-VBarGap;
- hsource1.top=hbar;
- hsource1.bottom=hsource1.top+HBarGap;
- hsource2.bottom=MAIN_WINDOW_HEIGHT-hbar;
- hsource2.top=hsource2.bottom-HBarGap;
- CopyBits(&(sourceGrafPtr->portBits), &(gMainWindow->portBits),
- &vsource1, &vsource1, 0, 0L);
- CopyBits(&(sourceGrafPtr->portBits), &(gMainWindow->portBits),
- &hsource1, &hsource1, 0, 0L);
- CopyBits(&(sourceGrafPtr->portBits), &(gMainWindow->portBits),
- &vsource2, &vsource2, 0, 0L);
- CopyBits(&(sourceGrafPtr->portBits), &(gMainWindow->portBits),
- &hsource2, &hsource2, 0, 0L);
- vbar+=VBarGap;
- hbar+=HBarGap;
- TimeCorrection(CorrectTime);
- }
- }
-